package com.itheima.demo7_实现多态.继承时的多态;

public class Test {
    public static void main(String[] args) {
         /*
            实现多态的三个条件:
                1.继承
                2.父类的引用指向子类的对象
                3.方法的重写
         */
        //多态
        Animal anl1 = new Dog();
        anl1.eat();

        Animal anl2 = new Cat();
        anl2.eat();
    }
}
